<template>
  <div class="page-tools">
    <el-row
      type="flex"
      justify="space-between"
      align="middle"
    >
      <el-col>
        <div
          v-if="showBefore"
          class="before"
        >
          <!-- 定义前边的插槽 -->
          <!-- 有名字的叫具名插槽   没名字都叫匿名插槽 -->
          <slot name="before" />
        </div>
      </el-col>
      <el-col>
        <el-row
          type="flex"
          justify="end"
        >
          <!-- 定义后面的插槽 -->
          <slot name="after" />
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  props: {
    showBefore: {
      type: Boolean,
      default: false
    }
  }
}
</script>
<style lang='scss'>
.page-tools {
  .before {
    line-height: 34px;
    display: inline-block;
    border-radius: 3px;
    color: #ffc0cb;
    font-size: 10px;
  }
}
</style>
